package com.aboo.infrastructure.mybatis.controller;


import com.aboo.infrastructure.base.constant.NumberConstant;
import com.aboo.infrastructure.base.domain.dto.Result;
import com.aboo.infrastructure.mybatis.entity.po.UserPo;
import com.aboo.infrastructure.mybatis.service.UserService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Yata.Aboo
 * @since 2021-07-24
 */
@RestController
@RequestMapping("/mybatis")
public class UserController {

    @Resource
    private UserService userService;

    @PostMapping("/save")
    public Result<Void> save() {
        UserPo userPo = new UserPo();
        userPo.setUserCode("008");
        userPo.setUserName("西侧");
        userPo.setAge(13);
        userPo.setSex("M");
        userPo.setDelFlag(NumberConstant.BYTE_1);
        userService.save(userPo);
        return Result.success();
    }

}
